import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
@Component({
  selector: 'app-table-form',
  templateUrl: './table-form.component.html',
  styleUrls: ['./table-form.component.css']
})
export class TableFormComponent implements OnInit {
  constructor(private http: HttpClient) {}
  dataSet = [];
  allData: any;
  ngOnInit() {
    this.http.get('http://www.zhengbenzixun.cn:8080/cityCount').subscribe(res => {
      this.allData = res;
      for (let i = 0; i < this.allData.length; i++) {
        this.allData[i].checked = false;
        this.dataSet = [...this.dataSet, this.allData[i]];
      }
    })
  }

}
